package com.slz3.business.module.goodsManagement.gooTypeLevel1.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooTypeLevel1.domain.GooTypeLevel1;
import com.slz3.business.module.goodsManagement.gooTypeLevel1.domain.GooTypeLevel1Condition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Controller
public class GooTypeLevel1ResController {

    @Resource
    private GooTypeLevel1ResAtomic gooTypeLevel1ResAtomic;

    public Mono<ServerResponse> add(ServerRequest req, GooTypeLevel1 gooTypeLevel1) {
        if (GooTypeLevel1ResUnsafeValid.add(req, gooTypeLevel1)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.add_$GooTypeLevel1UpdateLock(req, gooTypeLevel1);
        }
    }

    public  Mono<ServerResponse> delete(ServerRequest req, GooTypeLevel1Condition gooTypeLevel1Condition) {
        if (GooTypeLevel1ResUnsafeValid.delete(req, gooTypeLevel1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.delete_$GooTypeLevel1UpdateLock(req, gooTypeLevel1Condition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, GooTypeLevel1 gooTypeLevel1) {
        if (GooTypeLevel1ResUnsafeValid.modify(req, gooTypeLevel1)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.modify_$GooTypeLevel1UpdateLock(req, gooTypeLevel1);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (GooTypeLevel1ResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooTypeLevel1ResExecutor.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
        if (GooTypeLevel1ResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.info_$GooTypeLevel1UpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (GooTypeLevel1ResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooTypeLevel1ResExecutor.choice(req);
        }
    }

    public final Mono<ServerResponse> auditSubmit(ServerRequest req, GooTypeLevel1Condition gooTypeLevel1Condition) {
        //
        if (GooTypeLevel1ResUnsafeValid.auditSubmit(req, gooTypeLevel1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.auditSubmit_$GooTypeLevel1UpdateLock(req, gooTypeLevel1Condition);
        }
    }

    public final Mono<ServerResponse> audit(ServerRequest req, GooTypeLevel1Condition gooTypeLevel1Condition) {
        if (GooTypeLevel1ResUnsafeValid.audit(req, gooTypeLevel1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.audit_$GooTypeLevel1UpdateLock(req, gooTypeLevel1Condition);
        }
    }

    public final Mono<ServerResponse> auditReject(ServerRequest req, GooTypeLevel1Condition gooTypeLevel1Condition) {
        if (GooTypeLevel1ResUnsafeValid.auditReject(req, gooTypeLevel1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.auditReject_$GooTypeLevel1UpdateLock(req, gooTypeLevel1Condition);
        }
    }

    public final Mono<ServerResponse> usingEnable(ServerRequest req, GooTypeLevel1Condition gooTypeLevel1Condition) {
        if (GooTypeLevel1ResUnsafeValid.usingEnable(req, gooTypeLevel1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.usingEnable_$GooTypeLevel1UpdateLock(req, gooTypeLevel1Condition);
        }
    }

    public final Mono<ServerResponse> usingDisable(ServerRequest req, GooTypeLevel1Condition gooTypeLevel1Condition) {
        if (GooTypeLevel1ResUnsafeValid.usingDisable(req, gooTypeLevel1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooTypeLevel1ResAtomic.usingDisable_$GooTypeLevel1UpdateLock(req, gooTypeLevel1Condition);
        }
    }

}
